package com.baidu.baidumap;

import android.app.Activity;
import android.os.Bundle;

import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.model.LatLng;

public class BaseActivity extends Activity {
	protected BaiduMap baiduMap;
	protected MapView mapview;
	protected double latitude = 39.9054;
	protected double longitude = 116.390998;
	protected LatLng hmPos = new LatLng(latitude, longitude);
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		initManager();

		setContentView(R.layout.common);

		init();
	}
	private void initManager() {
		//SDKInitializer.initialize(getApplicationContext());
	}

	private void init() {

		mapview = (MapView) findViewById(R.id.bmapView);

		baiduMap = mapview.getMap();

		MapStatusUpdate mapstatusUpdate = MapStatusUpdateFactory.zoomTo(17);

		baiduMap.setMapStatus(mapstatusUpdate);


		MapStatusUpdate mapstatusUpdatePoint = MapStatusUpdateFactory
				.newLatLng(hmPos);

		baiduMap.setMapStatus(mapstatusUpdatePoint);


	}
	@Override
	protected void onDestroy() {
		mapview.onDestroy();
		super.onDestroy();
	}
	@Override
	protected void onResume() {
		mapview.onResume();
		super.onResume();
	}

	@Override
	protected void onPause() {
		mapview.onPause();
		super.onPause();
	}
}
